package com.base.cn.platform.os.service.exam.template;

import com.base.cn.platform.os.service.FeignAuthConfig;
import com.base.cn.platform.os.service.exam.ExamBaseService;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;
import java.util.Map;

/**
 * 试题模板接口
 *
 * @author s.li
 * @date 2018/11/15
 */
@FeignClient(name = ExamBaseService.appName,configuration = FeignAuthConfig.class)
public interface ExamQuestionTemplateService extends ExamBaseService {

    /**
     *  通过分页查询试题模板数据列表
     * @param condition 查询条件
     * @param currentPage 页码
     * @param pageSize 查询数量
     * @return PageInfo<ExamQuestionTemplate>
     */
    @RequestMapping(contextPath + "/findExamQuestionTemplatePage")
    Map<String,Object> findExamQuestionTemplatePage(@RequestBody Map<String, Object> condition,
                                                    @RequestParam(value = "currentPage", required = false, defaultValue = "1") int currentPage,
                                                    @RequestParam(value = "pageSize", required = false, defaultValue = "10") int pageSize);

    /**
     * 通过条件，查询试题模板数据列表
     * @param condition 查询条件
     * @return List<ExamQuestionTemplate>
     */
    @RequestMapping(contextPath + "/findExamQuestionTemplateList")
    List<Map<String,Object>> findExamQuestionTemplateList(@RequestBody Map<String, Object> condition);

    /**
     * 通过ID获取试题模板
     * @param condition 查询条件
     * @return 试题模板数据对象
     */
    @RequestMapping(contextPath + "/findExamQuestionTemplateById")
    Map<String,Object> findExamQuestionTemplateById(@RequestBody Map<String, Object> condition);

    /**
     * 修改试题模板状态
     * @param ids ID串
     * @param status 状态，1正常，2禁用
     */
    @RequestMapping(contextPath + "/updateExamQuestionTemplateStatus")
    void updateExamQuestionTemplateStatus(@RequestParam("ids") String ids, @RequestParam("status") int status);

    /**
     * 通过ID串删除试题模板数据
     * @param ids ID串
     */
    @RequestMapping(contextPath + "/deleteExamQuestionTemplateByIds")
    void deleteExamQuestionTemplateByIds(@RequestParam("ids") String ids);

    /**
     * 保存试题模板数据
     * @param examQuestionTemplate 试题模板数据对象
     * @return  Map<String,Object>
     */
    @RequestMapping(contextPath + "/saveTemplate")
    Map<String,Object> saveTemplate(@RequestBody Map<String, Object> examQuestionTemplate);

}
